#ifndef _DB_SQLITE3_H
#define _DB_SQLITE3_H

#include <wx/string.h>
#include <vector>
#include "dbase.h"
struct sqlite3;
class Note;
class NoteFilter;
class Keyword;

class DBsqlite3 : public DBase
{
private:
    sqlite3 *db_handle;
    bool modified;

    bool RegisterCallbacks();
    bool CheckFile(const wxString& name);
    bool Create(const wxString& name);
    void print_SQL_Error(wxString desc);

public:
    bool connected;

    DBsqlite3();
    ~DBsqlite3() {}

    bool Connect(const wxString& name);
    void Disconnect();
    bool isConnected() const;
    bool isModified() const;
    void setModified(bool value);

    bool ValidNoteID(int id);
    bool GetNoteCount(int *count);
    bool SelectByFilter(std::vector<Note> *notes, const NoteFilter& filter);
    bool WriteNewNote(Note &n);
    bool OverwriteNote(const Note& n);
    bool DeleteNote(int id);

    bool ValidKeywordID(int id);
    bool ReadKeywords(std::vector<Keyword> *keywords, const KeywordFilter& filter);
    bool WriteNewKeyword(Keyword& t);
    bool OverwriteKeyword(const Keyword& t);
    bool DeleteKeyword(int id);
};

#endif
